#pragma once

#define SPR_STATE_DEF 0

#include "Sprite.h"
class Sprites
{
public:
	// Bound rectangle of entity
	Rect* rect;
	// List of sprite to view state object
	std::map<int, Sprite*> *container;
	// Current sprite of object
	Sprite* currentSprite;
	// State of object to check match sprite
	int state;
	// Spriate handler to draw object
	LPD3DXSPRITE spriteHandler;
	// Flip matrix
	D3DXMATRIX* matrix;
	// Constructor, pointer of rect of object
	Sprites(Rect* rect);
	~Sprites();

	// draw current sprite
	void draw();
	void draw(int);
	// Add new sprite to container
	void addSprite(int state, int spriteId);
	void addSprite(int state, int spriteId, int framerate);
	// Get sprite with state input
	Sprite* getSprite(int state);
	// Check current state
	bool checkState(int state);

	// Update current sprite
	void updateCurrent();
	// Set state
	void setState(int state);
	void setCurrentToEnd();
	void setCurrentToStart();
	// Init sprites
	void initSprites();
	// Init state
	void initState();
	// Init rect
	void initRect(Rect* rect);
	// Init matrix
	void initMatrix(D3DXMATRIX* matrix);
	// Init sprite handler
	void initSpriteHandler(LPD3DXSPRITE spriteHandler);
};

